<%@ Page Title="" Language="C#" MasterPageFile="~/Principal.Master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="JA.Web.Apresentacao.Default" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .border1
        {
            border-bottom: solid 1px #E0E0E0;
            padding-top: 5px;
            padding-bottom: 10px;
            font-family: Verdana;
            font-size: 9pt;
            font-weight: bold;
            color: #dd6d00;
        }
        .border2
        {
            padding-top: 5px;
            font-family: Verdana;
            font-size: 7pt;
            font-weight: bold;
            color: #000080;
        }
        .border3
        {
            padding-top: 5px;
            font-family: Verdana;
            font-size: 8pt;
            font-weight: bold;
            color: Gray;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderDormitorios" runat="server">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
            <td align="left">
                Selecione dormit&oacute;rios :
                <asp:RadioButton ID="rbDormTodos" runat="server" GroupName="Dorm" AutoPostBack="true"
                    OnCheckedChanged="rbDorm_CheckedChanged" ToolTip="Busca independe da quantidade de dormitórios"
                    Text="Todos" Checked="true" />&nbsp;&nbsp;|
                <asp:RadioButton ID="rbDorm1" runat="server" GroupName="Dorm" AutoPostBack="true"
                    OnCheckedChanged="rbDorm_CheckedChanged" ToolTip="Busca apenas imóveis com 1 dormitório"
                    Text="1" />&nbsp;&nbsp;|
                <asp:RadioButton ID="rbDorm2" runat="server" GroupName="Dorm" AutoPostBack="true"
                    OnCheckedChanged="rbDorm_CheckedChanged" ToolTip="Busca apenas imóveis com 2 dormitórios"
                    Text="2" />&nbsp;&nbsp;|
                <asp:RadioButton ID="rbDorm3" runat="server" GroupName="Dorm" AutoPostBack="true"
                    OnCheckedChanged="rbDorm_CheckedChanged" ToolTip="Busca apenas imóveis com 3 dormitórios"
                    Text="3" />&nbsp;&nbsp;|
                <asp:RadioButton ID="rbDorm4" runat="server" GroupName="Dorm" AutoPostBack="true"
                    OnCheckedChanged="rbDorm_CheckedChanged" ToolTip="Busca imóveis com 4 ou mais dormitórios"
                    Text="4 ou mais" />
            </td>
            <td align="right">
                <asp:ImageButton ID="ImageButton1" Width="80" Height="29" runat="server" ImageUrl="~/App_Themes/Padrao/imagens/masterpage/contato.png"
                    OnClick="btContatoClick" />
            </td>
            <td align="left">
                <- Clique para entrar com contato conosco.
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table border="0" cellspacing="0" cellpadding="0" style="background-color: White;
        max-width: 1019px;">
        <tr>
            <td style="background-image: url(App_Themes/Padrao/imagens/masterpage/box_le.png);
                width: 14px; background-repeat: repeat-y;">
            </td>
            <td valign="top">
                <!-- filtro -->
                <table border="0" cellpadding="0" cellspacing="0" width="200" style="max-width: 200px;">
                    <tr>
                        <td align="left" class="border1">
                            Selecione transa&ccedil;&atilde;o:<br />
                            <asp:RadioButton ID="rbTransVda" runat="server" Text="Venda" GroupName="Trans" ForeColor="Black"
                                Checked="true" />
                        </td>
                    </tr>
                    <tr>
                        <td align="left" class="border1">
                            Tipo de im&oacute;vel:<br />
                            <asp:DropDownList ID="ddlTipo" runat="server" DataValueField="idTipo" DataTextField="tipo"
                                OnSelectedIndexChanged="ddlTipo_SelectedIndexChanged" AutoPostBack="true" Width="190">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" class="border1">
                            Selecione estado:<br />
                            <asp:DropDownList ID="ddlEstado" runat="server" DataValueField="siglaUf" DataTextField="uf"
                                OnSelectedIndexChanged="ddlEstado_SelectedIndexChanged" AutoPostBack="true" Width="190">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" class="border1">
                            Selecione cidade:<br />
                            <asp:DropDownList ID="ddlCidade" runat="server" DataValueField="idCidade" DataTextField="cidade"
                                OnSelectedIndexChanged="ddlCidade_SelectedIndexChanged" AutoPostBack="true" Width="190">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" class="border1">
                            Selecione bairro:<br />
                            <asp:DropDownList ID="ddlBairro" runat="server" DataValueField="idBairro" DataTextField="bairro"
                                OnSelectedIndexChanged="ddlBairro_SelectedIndexChanged" AutoPostBack="true" Width="190">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" class="border1">
                            Bairro adicional:
                            <asp:DropDownList ID="ddlBairro2" runat="server" DataValueField="idBairro" DataTextField="bairro"
                                OnSelectedIndexChanged="ddlBairro_SelectedIndexChanged" AutoPostBack="true" Width="190">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" class="border1">
                            Refer&ecirc;ncia do im&oacute;vel:
                            <asp:TextBox runat="server" ID="txtIdImovel" AutoPostBack="true" Style="border: solid 1px;
                                font-family: Verdana; font-size: 10pt; font-weight: bold; color: #dd6d00; width: 190px;
                                text-align: center; background-color: Black; color: White;" OnTextChanged="txtIdImovel_TextChanged" />
                        </td>
                    </tr>
                </table>
            </td>
            <td>
                <!-- conteudo -->
                <table border="0" cellpadding="0" cellspacing="0" width="791" style="max-width: 791px;">
                    <tr>
                        <td valign="top" align="left" style="border-left: dashed 1px #E0E0E0;">
                            <div style="min-height: 400px;">
                                <!-- Area de exibição dos imoveis encontrados pelo filtro-->
                                <table width="100%" border="0" cellpadding="1" cellspacing="1">
                                    <tr>
                                        <td align="left" valign="middle">
                                            <asp:Image Height="30" Width="50" ID="Image3" runat="server" ImageUrl="~/App_Themes/Padrao/imagens/masterpage/building.jpg" />
                                        </td>
                                        <td valign="top" class="border2">
                                            Dormit&oacute;rios:<br />
                                            <asp:Label ID="lblDorm" runat="server" Text="" CssClass="border3"></asp:Label>
                                        </td>
                                        <td valign="top" class="border2">
                                            Tipo de im&oacute;vel:<br />
                                            <asp:Label ID="lblTipo" runat="server" Text="" CssClass="border3"></asp:Label>
                                        </td>
                                        <td valign="top" class="border2">
                                            Estado:<br />
                                            <asp:Label ID="lblUF" runat="server" Text="" CssClass="border3"></asp:Label>
                                        </td>
                                        <td valign="top" class="border2">
                                            Cidade:<br />
                                            <asp:Label ID="lblCid" runat="server" Text="" CssClass="border3"></asp:Label>
                                        </td>
                                        <td valign="top" class="border2">
                                            Bairro:<br />
                                            <asp:Label ID="lblBai" runat="server" Text="" CssClass="border3"></asp:Label>
                                        </td>
                                        <td valign="top" class="border2">
                                            Bairro adicional:<br />
                                            <asp:Label ID="lblBai2" runat="server" Text="" CssClass="border3"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="7" align="left">
                                            <asp:Image ID="Image1" runat="server" ImageUrl="~/App_Themes/Padrao/imagens/masterpage/leftArrow.png" />
                                            <b style="font-family: Verdana; font-size: 9pt; color: #dd6d00;">Utilize os filtros
                                                ao lado para encontrar o im&oacute;vel desejado.</b>
                                        </td>
                                    </tr>
                                </table>
                                <asp:Panel ID="PanelWelcome" runat="server" Visible="true">
                                    <table width="100%" border="0" style="color: #dd6d00; height: 318px; background-image: url('App_Themes/Padrao/imagens/masterpage/fundo2.png');">
                                        <tr>
                                            <td colspan="3" align="center" valign="top" style="height: 110px; font-size: 19pt;">
                                                <table border="0" cellpadding="0" cellspacing="0">
                                                    <tr>
                                                        <td valign="middle">
                                                            <asp:Image ID="Image2" runat="server" ImageUrl="~/App_Themes/Padrao/imagens/masterpage/home.png" />
                                                        </td>
                                                        <td valign="middle">
                                                            <asp:LinkButton ID="LinkButton1" ForeColor="Red" runat="server" OnClick="btVendaClick">
                                                                     <b>&nbsp;&nbsp;Clique Aqui&nbsp;&nbsp;</b>
                                                            </asp:LinkButton>
                                                        </td>
                                                        <td valign="middle">
                                                            <asp:Image ID="Image4" runat="server" ImageUrl="~/App_Themes/Padrao/imagens/masterpage/home.png" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 5px;">
                                                &nbsp;
                                            </td>
                                            <td align="center" valign="top" style="height: 45px; border: dashed 1px #dd6d00;
                                                background-color: White; font-family: Verdana; padding-top: 5px; padding-bottom: 5px;">
                                                <b style="font-size: 15pt;">JOS&Eacute; IM&Oacute;VEIS<br />
                                                </b><b style="font-size: 12pt;">Vende apartamentos, casas e sobrados em cond. fechado
                                                    na Z.Norte de S&atilde;o Paulo </b>
                                            </td>
                                            <td style="width: 6px;">
                                                &nbsp;
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="height: 140px;">
                                                &nbsp;
                                            </td>
                                            <td>
                                                &nbsp;
                                            </td>
                                            <td>
                                                &nbsp;
                                            </td>
                                        </tr>
                                    </table>
                                </asp:Panel>
                                <asp:Panel ID="PanelImoveis" runat="server" Visible="false">
                                    <asp:Repeater ID="RepeaterImoveis" runat="server">
                                        <HeaderTemplate>
                                            <table border="0" cellpadding="5" cellspacing="5">
                                                <tr>
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <%# (Container.ItemIndex!=0 && Container.ItemIndex%4==0?"</tr><tr>":"") %>
                                            <td valign="top" style="width: 150px; height: 200px; border: dashed 1px #E0E0E0;">
                                                <div style="font-family: Verdana; width: 150px;">
                                                    <div style="height: 115px;">
                                                        <asp:ImageButton ID="ImageButton2" Style="max-width: 150px; max-height: 150px;" runat="server"
                                                            AlternateText='<%#DataBinder.Eval(Container.DataItem,"Titulo") %>' ImageUrl='<%#"~/DownFoto.aspx?idImovel="+Eval("IdImovel")+"&type=medium" %>'
                                                            PostBackUrl='<%#"~/DetalheImovel.aspx?idImovel="+Eval("IdImovel") %>' />
                                                    </div>
                                                    <table style="border-bottom: solid 1px #dd6d00;">
                                                        <tr>
                                                            <td align="right" style="width: 65px; font-family: Verdana; font-size: 7pt; font-weight: bold;
                                                                color: #000060;">
                                                                C&oacute;digo&nbsp;
                                                            </td>
                                                            <td align="center" style="border: solid 1px; font-family: Verdana; font-size: 10pt;
                                                                font-weight: bold; color: #dd6d00; width: 80px; text-align: center; background-color: Black;
                                                                color: White;">
                                                                <div>
                                                                    <%#Eval("IdImovel") %></div>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                    <asp:LinkButton ID="lbImovel" runat="server" PostBackUrl='<%#"~/DetalheImovel.aspx?idImovel="+Eval("IdImovel") %>'
                                                        Font-Underline="false">
                                                        <div style="font-size:14px; color:Black; font-weight:bold;"><%#DataBinder.Eval(Container.DataItem,"Titulo") %></div>
                                                        <div style="font-size:10px; color:#dd6d00;font-weight:bold; margin-top:5px;"><%#DataBinder.Eval(Container.DataItem,"BairroVO") %></div>
                                                        <div style="font-size:10px; color:#dd6d00;font-weight:bold;"><%#DataBinder.Eval(Container.DataItem,"TipoVO") %></div>
                                                        <div style="font-size:14px; color:Black; font-weight:bold;"><%#"R$ "+String.Format("{0:n2}",DataBinder.Eval(Container.DataItem,"vlrTotVda")) %></div>
                                                        <div style="color:#000080; margin-top:5px;">Venda</div>
                                                        <div style="font-family:Verdana; font-size:9px; color:Red;">( Clique para ver Im&oacute;vel )</div> 
                                                    </asp:LinkButton>
                                                </div>
                                                <br />
                                            </td>
                                        </ItemTemplate>
                                        <SeparatorTemplate>
                                        </SeparatorTemplate>
                                        <FooterTemplate>
                                            </tr> </table>
                                        </FooterTemplate>
                                    </asp:Repeater>
                                </asp:Panel>
                            </div>
                        </td>
                    </tr>
                </table>
            </td>
            <td style="background-image: url(App_Themes/Padrao/imagens/masterpage/box_ld.png);
                width: 14px; background-repeat: repeat-y;">
            </td>
        </tr>
        <tr>
            <td style="background-image: url(App_Themes/Padrao/imagens/masterpage/box_ie.png);
                width: 14px; height: 14px; background-repeat: repeat-y;">
            </td>
            <td style="background-image: url(App_Themes/Padrao/imagens/masterpage/box_ir.png);
                height: 14px; background-repeat: repeat-x;">
            </td>
            <td style="background-image: url(App_Themes/Padrao/imagens/masterpage/box_ir.png);
                height: 14px; background-repeat: repeat-x;">
            </td>
            <td style="background-image: url(App_Themes/Padrao/imagens/masterpage/box_id.png);
                width: 14px; height: 14px; background-repeat: repeat-y;">
            </td>
        </tr>
    </table>
</asp:Content>
